package com.itheima.reggie.controller;
import com.itheima.reggie.common.R;
import com.itheima.reggie.entity.Cash;
import com.itheima.reggie.entity.Statics;
import com.itheima.reggie.service.StaticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/statics")
public class StaticsController {
    @Autowired
    private StaticsService staticsService;

    @GetMapping("/dishCash")
    public R dishCash(){
        Statics dishCategoryCash = staticsService.getDishCategoryCash();
        return R.success(dishCategoryCash);
    }


    @GetMapping("/setmealCash")
    public R setmealCash(){
        Statics setmeal = staticsService.getSetmealCategoryCash();
        List<Cash> setmealCash = setmeal.getSetmealCash();
        return R.success(setmealCash);
    }

    @GetMapping("/dishNum")
    public R dishNum(){
        Statics dish = staticsService.getDishNum();
        List<Cash> dishNum= dish.getDishNum();
        return R.success(dishNum);
    }


    @GetMapping("/setmealNum")
    public R setmealNum(){
        Statics setmealNum = staticsService.getSetmealNum();
        return R.success(setmealNum );
    }
}